//
//  DCLogger.h
//  DongCi
//
//  Created by kenshin on 22/05/2017.
//  Copyright © 2017 wmlives. All rights reserved.
//

#import <CocoaLumberjack/CocoaLumberjack.h>

extern DDLogLevel ddLogLevel;

#ifndef LOG_ASYNC_ENABLED
#define LOG_ASYNC_ENABLED YES
#endif

//在这定义特殊的日志level
//网络日志
#define LOG_FLAG_NetWorkClient  (1 << 5) // 0...0100000
#define DDLogNetWorkClient(frmt, ...)  LOG_MAYBE(YES, ddLogLevel, LOG_FLAG_NetWorkClient,  0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
//Socket日志
#define LOG_FLAG_WebSocket  (1 << 6)
#define DDLogWebSocket(frmt, ...) LOG_MAYBE(YES, ddLogLevel, LOG_FLAG_WebSocket, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)

// Now we decide which flags we want to enable in our application

//#define LOG_FLAG_TIMERS (LOG_FLAG_HHNetWorkClient | LOG_FLAG_HHLog)



// ========================= Overrides ========================================
// --> per https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomLogLevels
// ----------------------------------------------------------------------------

// Are we in an optimized (i.e. Release) build?
#ifdef __OPTIMIZE__
// YES: Nothing to do from the default. (You could simplify this by using #ifndef above instead)
#else
// NO: We're in a Debug build. As such, let's configure logging to flush right away.
// Undefine the asynchronous defaults:
#undef LOG_ASYNC_VERBOSE
#undef LOG_ASYNC_INFO
#undef LOG_ASYNC_WARN

// Define the logs levels to be synchronous:
#define LOG_ASYNC_VERBOSE   (NO && LOG_ASYNC_ENABLED)   // Debug logging will be synchronous
#define LOG_ASYNC_INFO      (NO && LOG_ASYNC_ENABLED)   // Info logging will be synchronous
#define LOG_ASYNC_WARN      (NO && LOG_ASYNC_ENABLED)   // Warn logging will be synchronous
#endif

